package data;

import java.util.Arrays;

public class Solution {
	private final int [] scenesOrder;
	private final float cost;
	
	/**
	 * Creates solution by specified order of scenes and cost.
	 * @param scenesOrder - array with optimal positions of tasks (position of scene with index n is located in array by index n)
	 * @param cost the record, corresponding the order of scenes.
	 */
	public Solution(int[] scenesOrder, float cost) {
		if(scenesOrder == null)
			throw new IllegalArgumentException("null");
		this.scenesOrder = scenesOrder;
		this.cost = cost;
	}
	
	public int getScenesNumber() {
		return scenesOrder.length;
	}

	public int[] getScenesOrder() {
		return scenesOrder;
	}

	public float getCost() {
		return cost;
	}
	
	@Override
	public String toString() {
		return String.format("%f(%s)", cost, Arrays.toString(scenesOrder));
	}
	
}
